//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

package finalexamproj;

//import inet.linklayer.mfcore.WirelessMac;
import inet.world.ChannelControl;

import inet.nodes.inet.Router;
import inet.nodes.wireless.WirelessAPWithEthSimplified;
import inet.nodes.wireless.WirelessAPSimplified;
import inet.nodes.wireless.WirelessHostSimplified;
import inet.nodes.ethernet.EtherSwitch;
import inet.nodes.wireless.WirelessAPWithEth;
import inet.networklayer.autorouting.FlatNetworkConfigurator;
import ned.DatarateChannel;
import inet.nodes.inet.StandardHost;
import inet.nodes.wireless.WirelessHost;
import ned.DatarateChannel;

import inet.applications.udpapp.UDPBasicApp;
simple VoiceOvIP extends UDPBasicApp
{
    @class(VoiceOvIP);
}

network Network
{
    parameters:
        int NumOfHttpClients = default(1);
        int NumOfVoIPClients = 1;
        int NumOfFTPClients = 1;
        int ISPDatarate @unit(Mbps) = default(1Mbps);

    types:
        channel Backbone extends DatarateChannel
        {
        }

        channel ISPConnection extends DatarateChannel
        {
            delay = 15ms;
            datarate = ISPDatarate;
        }
    submodules:
        Server: StandardHost {
            @display("i=misc/globe");
        }

        accessPoint: WirelessAPWithEthSimplified;
        //VoIP client
        voipHost[NumOfVoIPClients]: WirelessHostSimplified {
            @display("is=s;i=device/cellphone2");
        }

        //ftp client
        ftpHost[NumOfFTPClients]: WirelessHostSimplified {
            @display("is=s;i=device/disk");
        }

        //http webbrowsing clients
        httpHost[NumOfHttpClients]: WirelessHostSimplified {
            @display("is=s;i=device/wifilaptop");
        }

        channelControl: ChannelControl;
        Router: Router {
            routingFile = "RT_Router.mrt";
        }

        ISPRouter: Router {
            routingFile = "RT_ISPRouter.mrt";
        }

        flatNetworkConfigurator: FlatNetworkConfigurator;
        FTPServer: StandardHost {
            @display("i=misc/globe;p=47,338");
        }

    connections:

        Server.pppg++ <--> Backbone <--> ISPRouter.pppg++;
        ISPRouter.pppg++ <--> ISPConnection <--> Router.pppg++;
        FTPServer.pppg++ <--> Backbone <--> ISPRouter.pppg++;
        Router.ethg++ <--> accessPoint.ethg++;
}
